package WordFrequent;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class control {
    public static void main(String[] args) {
        File file1 = new File("D:\\大三上\\软件工程\\project\\sum of word\\word\\word0.txt");
        String path = new String("D:\\大三上\\软件工程\\project\\sum of word\\word");
        File file2 = new File("D:\\大三上\\软件工程\\project\\sum of word\\word\\paragraph\\paragraph .txt");
        Scanner scanner = new Scanner(System.in);
        String writter = new String();

        boolean flag = true;
        while (flag) {
            writter = scanner.next();
            switch (writter) {
                case "-c":
                    measure.step0(file1);
                    break;//得到字母次数和频率
                case "-f":
                    measure.step1(file1);
                    break;//输出文件中所有不重复的单词，按照出现次数由多到少排列，出现次数同样多的，以字典序排列。
                case "-d":
                    measure.step2(path);
                    break;//指定文件目录，对目录下每一个文件执行 wf.exe -f 的操作。
                case "-d-s":
                    measure.step3(path);
                    break;//同上， 但是会递归遍历目录下的所有子目录。
                case "-n": {
                    int n = scanner.nextInt();
                        measure.step4(file1,n);
                    break;
                }
                case "-x-f":measure.step5(file1);break;
                case "-v":measure.step6(file2);break;
                case "exit":{
                    flag = false;
                    System.out.println("您已经退出程序！");break;
                }

            }


        }
    }
}
